import * as constants from '../Constants'
import { get, GET_APPLY_LIST } from '../../service/api'

export interface GetApplyList {
  type: constants.GetApplyList
  payload: Promise<any>
}
export interface GetApplyList_PENDING {
  type: constants.GetApplyList_PENDING
  payload: Promise<any>
}
export interface GetApplyList_FULFILLED {
  type: constants.GetApplyList_FULFILLED
  payload: any
}
export interface GetApplyList_Type {
  type: constants.GetApplyList_Type
  payload: number
}


export type ApplyAction = GetApplyList | 
  GetApplyList_FULFILLED | 
  GetApplyList_PENDING |
  GetApplyList_Type

export function recordType(param: number): GetApplyList_Type {
  return {
    type: constants.GetApplyList_Type,
    payload: param
  }
}

export function getApplyList(param: any): GetApplyList {
  return {
    type: constants.GetApplyList,
    payload: get(GET_APPLY_LIST, param)
  }
}